package com.itheima.demo;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * @param
 * @return
 */
public class Demo {
    @Test
    public void test1() throws Exception {
        //获取ioc容器
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        //获取业务层接口资源
        UserService bean = ac.getBean(UserService.class);
        List<User> all = bean.findAll();
        System.out.println("all = " + all);
    }
}
